import { Button, Input, List, Upload } from 'antd'
import React, { useEffect, useState } from 'react'

function index() {
  const [wowDir, setWowDir] = useState("")
  useEffect(() => {
    getWowDir()
  }, [])
  const getWowDir = async () => {
    if (window.getWowDir) {
      let res = await window.getWowDir()
      setWowDir(res ? res : "")
    }
  }
  return (
    <div style={{
      height: 200,
      paddingLeft: 16,
      paddingRight: 16
    }}>
      <List>
        <List.Item>

          <Button onClick={async () => {
            if (window.selectWowDir) {
              let wowDir = await window.selectWowDir()
              console.log(wowDir)
              setWowDir(wowDir)
            }
          }}>选择魔兽世界正式服目录</Button>

          <div>{wowDir}</div>
        </List.Item>
      </List>
    </div>
  )
}

export default index
